package com.xin.config;

import com.xin.service.PermissionService;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 该类扫描controller包下的所有类，将权限信息注入到权限表中
 */
@Configuration
public class InitPermission implements ApplicationContextAware {

    @Resource
    private PermissionService permissionService;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        //初始化权限信息
        permissionService.addList(applicationContext);

    }


}
